﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;

namespace GameServer.Networking.Packets
{
    class PACKET_USER_LIST : Packet
    {
        public PACKET_USER_LIST(ArrayList PlayerList)
        {
            newPacket(28960);
            addBlock(PlayerList.Count);

            foreach (Virtual_Objects.User.virtualUser _Client in PlayerList)
            {
                addBlock(_Client.UserID);
                addBlock(_Client.Nickname);
                addBlock(_Client.Premium);
                addBlock(_Client.ClanID);
                addBlock(Managers.LevelCalculator.getLevelforExp(_Client.Exp));
                addBlock(_Client.Channel);
                if (_Client.Room == null || _Client.isSpectating == true)
                    addBlock(-1);
                else
                    addBlock(_Client.Room.ID);
                addBlock(-1);
            }
        }
    }
}
